Skip to content

Conversation

@lalala-2
Copy link

1. Call get_block_size to determine the number of bytes each block contains, including the metaheader.
2. During checkpointing, call get_kv_with_metaheader_from_storage to retrieve the weights_with_metaheader for specified IDs. The first dimension of the weights_with_metaheader tensor should match the IDs, and the second dimension's number of bytes should match the byte size obtained in step 1. For example, if using uint8 type, the second dimension should match the byte size acquired in step 1.
3. During restoration, call set_kv_with_metaheader_to_storage to restore. Only need to provide weights_with_metaheader, as it contains complete information including keys, values, and feature counts.

@netlify
Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit cdd46b6
🔍 Latest deploy log https://app.netlify.com/projects/pytorch-fbgemm-docs/deploys/684bdc0063509c00086ab26f
😎 Deploy Preview https://deploy-preview-4342--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@facebook-github-bot
Copy link
Contributor

Hi @lalala-2!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@lalala-2
Copy link
Author

Due to compilation issues with fbgemm_gpu/src/dram_kv_embedding_cache/dram_kv_embedding_base.h, we mocked a SimpleDramKVEmbeddingCache in fbgemm_gpu/test/dram_kv_embedding_cache/ckpt_restore_test.cpp to test the interfaces get_block_size, get_kv_with_metaheader_from_storage, and set_kv_with_metaheader_to_storage.

@facebook-github-bot
Copy link
Contributor

@q10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@q10
Copy link
Contributor

q10 commented Jul 1, 2025

Hi @lalala-2 I believe @bobbyliujb is working on this over at #4429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants